//package com.cbgolf.oa.manager;
//
//import android.util.Log;
//import com.cbgolf.oa.net.WebAPI;
//import com.cbgolf.oa.util.DataUtil;
//import io.crossbar.autobahn.wamp.Client;
//import io.crossbar.autobahn.websocket.WebSocketConnection;
//import io.crossbar.autobahn.websocket.WebSocketConnectionHandler;
//import io.crossbar.autobahn.websocket.exceptions.WebSocketException;
//import io.crossbar.autobahn.websocket.interfaces.IWebSocket;
//import io.crossbar.autobahn.websocket.types.WebSocketOptions;
//
///**
// * Created by lq on 2018/5/2.
// */
//
//public class WsAutoBahn {
//
//  static final String TAG = "WsAutoBahn";
//
//  private final IWebSocket mConnection = new WebSocketConnection();
//  String url =
//      "ws://test.cbgolf.cn/backend/messages/queue/messageNotify/" + DataUtil.getUserId();
//  private void start() {
//
//    WebSocketOptions connectOptions = new WebSocketOptions();
//    connectOptions.setReconnectInterval(5000);
//    String configUrl = new StringBuilder()
//        .append("ws://")
//        .append(WebAPI.IP)
//        .append(WebAPI.web_socket)
//        .toString();
//    try {
//      mConnection.connect(configUrl, new WebSocketConnectionHandler() {
//        @Override
//        public void onOpen() {
//
//        }
//
//        @Override
//        public void onMessage(String payload) {
//        }
//
//        @Override
//        public void onClose(int code, String reason) {
//        }
//      }, connectOptions);
//    } catch (WebSocketException e) {
//      Log.e(TAG, e.toString());
//    }
//
//
////    Session session = new Session();
//    // Add all onJoin listeners
//
////    session.addOnJoinListener(demonstrateSubscribe);
////    session.addOnJoinListener(demonstratePublish);
////    session.addOnJoinListener(demonstrateCall);
////    session.addOnJoinListener(demonstrateRegister);
//
//    // finally, provide everything to a Client and connect
//    Client client = new Client(null, configUrl, url);
//    client.connect();
//
//
//  }
//
////    @Override
////    protected void onDestroy() {
////      super.onDestroy();
////      if (mConnection.isConnected()) {
////        mConnection.sendClose();
////      }
////    }
//
//
//}
